package com.iot.config.satoken;

import cn.dev33.satoken.stp.StpInterface;
import cn.dev33.satoken.stp.StpUtil;
import com.google.common.collect.Lists;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class StpInterfaceImpl implements StpInterface {

    /**
     * 返回一个账号所拥有的权限码集合
     */
    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return (List<String>) StpUtil.getSession().get("authList");
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return Lists.newArrayList();
    }
}